package Controller;
import Model.*;


/**
 * Write a description of class CDSamlingCtr here.
 * 
 * @author (Ricki Jensen) 
 * @version (30.10.2010)
 */
public class CDSamlingCtr
{

    private static CDSamlingCtr _instance = null;
    private CDSamling cdSamling;
    
    public static CDSamlingCtr getInstance() {
      if(null == _instance) {
         _instance = new CDSamlingCtr();
      }
      return _instance;
   }
    
    private CDSamlingCtr()
    {
        cdSamling = CDSamling.getInstance();        
    }
    
    public void opretCD(int nr, String titel) {
        CD cd = new CD(nr, titel);
        cdSamling.addCD(cd);
    }
    
    public void findCD(String titel) {
        //print all information
        CD cd = cdSamling.findCD(titel);
        
        if (cd != null)
            cd.printInfo();
    }
}


